package com.kay.web;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * @Description: 通过@ComponentScan来进行包扫描
 * @Author: Kay
 * @CreateDate: 2021/7/26$ 21:00$
 * @UpdateUser: Kay
 * @UpdateDate: 2021/7/26$ 21:00$
 */
@Configuration
@ComponentScan("com.kay")
public class AppConfig {
    /**
     * 将DispatcherServlet注册到Ioc容器
     */
    @Bean
    public DispatcherServlet getDispatcherServlet(){
        DispatcherServlet dispatcherServlet = new DispatcherServlet();
        return dispatcherServlet;
    }
}
